package com.xiaoma.thread.wait.qiou;


public class ThreadDemo implements Runnable {

  private String str_thread_name;
  private Thread t;
  private Object o;

  public ThreadDemo(String str_thread_name, Object o) {
    this.str_thread_name = str_thread_name;
    this.o = o;
  }

  public void start() {
    if (this.t == null) {
      this.t = new Thread(this, str_thread_name);
      this.t.start();
    }
  }

  @Override
  public void run() {/*

    while (num <= 100) {
      synchronized (num) {
        if (!num.flag) {
          try {
            num.wait();  //操作wait()函数的必须和锁是同一个
          } catch (Exception e) {
          }
        } else {
          System.out.println("oushu-----" + num.i);
          num.i++;
          num.flag = false;
          num.notify();
        }
      }
    }*/
  }


}
